#!/usr/bin/env python

import os, sys

if (len(sys.argv) != 3):
    print "Usage: " + sys.argv[0] + " file-to-run logfile-name"
    exit()

threads = [1, 2, 4, 8, 16]
numbers = [1, 10, 50, 100, 200, 500, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000]

for t in threads:
    for i in numbers:
        print '== Number of Threads: ' + str(t) + ' =='
        os.system('export OMP_NUM_THREADS=' + str(t) + '; ' + sys.argv[1] + ' -s 2 -n ' + str(i) + ' | tee -a '+sys.argv[2])
